package com.aerotechnic.entities;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Table(name = "Visite")
public class Visite extends BaseEntity{

	
	private static final long serialVersionUID = 1L;
	
	@Column(name = "INTITULE")
	private String intitule;
	@Column(name = "DESCRIPTION")
	private String desc;
	@Column(name = "TYPE_CHECK")
	private String check;
	@Column(name = "Charge")
	private Float  charge;
	@Column(name="DATE_DEBUT")
	Date dateDebut;
	@Column(name="DATE_Fin")
	Date dateFin;
	
	//***************** links ********************
	
	@OneToMany(fetch = FetchType.EAGER, targetEntity = JourFerie.class)
	private Set<JourFerie> jourFeries = new HashSet<JourFerie>(0);
	
	
	@ManyToOne(fetch = FetchType.EAGER, targetEntity = Avion.class)
	private Avion avion;
	
	@OneToOne(fetch = FetchType.EAGER, targetEntity = Planning.class)
	private  Planning planning;
	
	
	public String getIntitule() {
		return intitule;
	}
	public void setIntitule(String intitule) {
		this.intitule = intitule;
	}
	
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public String getCheck() {
		return check;
	}
	public void setCheck(String check) {
		this.check = check;
	}
	public Avion getAvion() {
		return avion;
	}
	public void setAvion(Avion avion) {
		this.avion = avion;
	}
	public Planning getPlanning() {
		return planning;
	}
	public void setPlanning(Planning planning) {
		this.planning = planning;
	}
	
	public Date getDateDebut() {
		return dateDebut;
	}
	public void setDateDebut(Date dateDebut) {
		this.dateDebut = dateDebut;
	}
	public Date getDateFin() {
		return dateFin;
	}
	public void setDateFin(Date dateFin) {
		this.dateFin = dateFin;
	}
	
	
	public Set<JourFerie> getJourFeries() {
		return jourFeries;
	}
	public void setJourFeries(Set<JourFerie> jourFeries) {
		this.jourFeries = jourFeries;
	}
	
	public Float getCharge() {
		return charge;
	}
	public void setCharge(Float charge) {
		this.charge = charge;
	}
	
	@Override
	public String toString() {    
		return "Visite [intitule=" + intitule + ", desc=" + desc + ", check="
				+ check + ", charge=" + charge + ", dateDebut=" + dateDebut
				+ ", dateFin=" + dateFin + ", jourFeries=" + jourFeries
				+ ", avion=" + avion + ", planning=" + planning + ", id=" + id
				+ "]";
	}   
	
}
